import axios from '../axios';

/**
 * 根据ID获取用户信息
 * @param userId 用户id
 * @returns {AxiosPromise}
 */
export const getUserInfo = (userId) => axios({
  url: '/getUserInfo',
  method: 'get',
  params: {
    userId
  }
});

/**
 * 更新邮箱
 * @param Form
 * @returns {AxiosPromise}
 */
export const updateUserEmailApi = (Form) => axios({
    url: '/updateUserEmail',
    method: 'put',
    data: Form
})

/**
 * 实名认证
 * @param Form
 * @return {AxiosPromise}
 */
export const certificateApi = (Form) => axios({
    url: '/certificate',
    method: 'put',
    data: Form
})
export const refeshToken = () => axios({
  url:  '/refresh',
  method: 'post'
})

export const sendLogs = (list) => axios({
  url: '/logout',
  method: 'post',
  data: list
})

export const logout = () => axios({
  url: '/logout',
  meta: {
    isToken: false
  },
  method: 'get'
})

/**
 * 通过用户名或者手机号搜索用户信息
 * @param content 搜索内容
 * @return {AxiosPromise} 符合条件的用户信息
 */
export const getUserBySearchApi = (content) => axios({
    url: '/getUserBySearch',
    method: 'get',
    params:{
      content
    }
})
